#!/bin/bash
# Requires Python, Hunspell and PyHunspell
# Python should come pre-installed
# To get the others run
#   sudo apt-get install hunspell python-dev libhunspell-dev
# Then download PyHunspell from http://code.google.com/p/pyhunspell/downloads/list
# and install it by running it's setup.py as 
#   sudo ./setup.py install 
# to install PyHunspell 
PATTERN=$1
CURDIR=`pwd`
for testfile in `find -iname "$PATTERN*test.py"`; do
 echo "Running tests in $testfile"
 DIRNAME=`dirname $testfile`
 BASENAME=`basename $testfile`
 cd $DIRNAME  #Change into that directory before running the test
 python $BASENAME
 cd $CURDIR  #Change back to current directory to get ready for next test
done;

